package graphicView;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import model.*;
import java.util.Observable;

//ClassGraphicObject is built with ClassImpl object. Run ClassGraphicObject.drawClass(g) where g is the graphics object of the JPanel.
/**
 * Team EBE
 * 
 * ClassGraphicObject.java is the incomplete implementation of a graphical
 * object representing the class
 * 
 */
public class RelationshipGraphicObject extends Observable {
	private RelationshipImpl relationshipObject;
	private boolean active = false;

	public RelationshipGraphicObject(RelationshipImpl relationshipObjectIn) {
		this.relationshipObject = relationshipObjectIn;
	}
	
	public RelationshipImpl getModel(){
		return relationshipObject;
	}

	public void activate() {
		active = true;
	}

	public void deactivate() {
		active = false;
	}

	public boolean isActive() {
		return active;
	}

	public void sendToInspector() {
		System.out.println("bleck");
		setChanged();
		notifyObservers(this.relationshipObject);
	}

	public void drawRelationship(Graphics g) {
		
		g.drawLine(relationshipObject.getSrc().x, relationshipObject.getSrc().y, relationshipObject.getDest().x, relationshipObject.getDest().y);
		

	}

}
